package com.currency.authorization.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

/**
 * @author Lan
 * @date 2021/12/14
 */
@RestController
@RequestMapping("/x")
public class TestController {

    /**
     * 当前的登录的用户对象
     * @param principal 用户对象
     * @return
     */
    @GetMapping("/getUserInfo")
    public Principal userInfo(Principal principal) {
        System.out.println(principal);
        return principal;
    }
}
